﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Paint.DefinePaintBrush.CApPaintBrush
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System.ComponentModel;
using System.Windows.Media;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.Paint.DefinePaintBrush;

public class CApPaintBrush : INotifyPropertyChanged
{
  private string _brushId;
  private string _name;
  private ITx2Or3DimensionalGeometry _solid;
  private TxFrame _originFrame;
  private TxRobot _robot;

  public bool InvalidData
  {
    get
    {
      return this.Solid == null || TxFrame.op_Equality(this.OriginFrame, (ITxObject) null) || !TxPaintThicknessFunctionHyperLoader.The.LoadedFunctions.Contains(this.Name);
    }
  }

  public Brush InvalidColor
  {
    get
    {
      return (Brush) new SolidColorBrush(TxStatusColor.ToColor(TxStatusColor.TextWithoutBackground("Error")));
    }
  }

  public string BrushId
  {
    get => this._brushId;
    set => this._brushId = value;
  }

  public string Name
  {
    get => this._name;
    set
    {
      this._name = value;
      this.NotifyPropertyChanged(nameof (Name));
    }
  }

  public TxRobot Robot
  {
    get => this._robot;
    set
    {
      this._robot = value;
      this.NotifyPropertyChanged(nameof (Robot));
    }
  }

  public ITx2Or3DimensionalGeometry Solid
  {
    get => this._solid;
    set
    {
      this._solid = value;
      this.NotifyPropertyChanged(nameof (Solid));
      this.NotifyPropertyChanged("InvalidData");
    }
  }

  public TxFrame OriginFrame
  {
    get => this._originFrame;
    set
    {
      this._originFrame = value;
      this.NotifyPropertyChanged(nameof (OriginFrame));
      this.NotifyPropertyChanged("InvalidData");
    }
  }

  public event PropertyChangedEventHandler PropertyChanged;

  protected void NotifyPropertyChanged(string propertyName)
  {
    if (this.PropertyChanged == null)
      return;
    this.PropertyChanged((object) this, new PropertyChangedEventArgs(propertyName));
  }
}
